home *** CD-ROM | disk | FTP | other *** search
Text File | 1998-03-19 | 29.7 KB | 846 lines | [TEXT/MPS ] |
- #
- # ****************************************************************************
- #
- # File Name: ExceptionHandling.lib
- #
- # Contains: xxx put contents here xxx
- #
- # Written by: PUT NAMES OF ALL SOFTWARE AUTHORS HERE
- #
- # Copyright: © 1994-1996 by Apple Computer, Inc., all rights reserved.
- #
- # ****************************************************************************
- # C h a n g e H i s t o r y (most recent first):
- # ****************************************************************************
- #
- # Vers Date Author Description
- # ---- -------- ------ ---------------------------------------------
- # <1.0.20> 02/05/97 SBR Updated version resource to 1.2.3.
- # <1.0.19> 02/05/97 SBR Modified _Match, _MatchBoolean, _SelectBoolean, _Collect.
- # <1.0.18> 6/17/96 MDF Modified _Launch() task to include inForeground parameter.
- # 1.0.17+> 6/17/96 MDF Modified _Launch() task to include inForeground parameter.
- # <1.0.17> 11/15/95 ML _Size - switch on pHow, default to 'wh', rename 1st param,
- # default to window desc.
- # 1.0.16+> 11/15/95 ML _Size - Revise defaults for pHow
- # <1.0.16> 5/18/95 ML All _tasks now pass task name and parameters into
- # ExceptionHandler() call.
- # 1.0.15+> 5/17/95 ML Changes to support Clouseau merge
- # <1.0.15> 4/12/95 KTA _MatchBoolean() - Added pExactFlag parameter.
- # <1.0.14> 3/6/95 ML SpecialHandlers() - Rename gSpecialErrorHandlers to
- # gSpecialExceptionHandlers
- # 1.0.13+> 3/6/95 ML rename g
- # <1.0.13> 2/17/95 ML Replace logstr() calls with Println - don't want any
- # other lib dependencies
- # 1.0.12+> 2/17/95 ML Replace logstr() calls with Println - don't want any other lib
- # dependencies
- # <1.0.12> 2/16/95 KTA ExceptionDispatcher() - Handle case when global
- # gExceptionHandlerList is not defined, and when no handler (or
- # default) is defined.
- # <1.0.11> 2/6/95 ML Add Throw parameter to DefaultExceptionHandler();
- # 1.0.10+> 2/3/95 ML Add Throw parameter to DefaultExceptionHandler();
- # <1.0.10> 1/31/95 KTA Moved some crash handling code to the CrashHandling.Lib
- # <1.0.9> 1/19/95 KTA Changed several names: ExceptionHandler() ->
- # ExceptionDispatcher(), gErrorList -> gExceptionHandlerList,
- # PopError() -> RemoveExceptionHandler, PushError() ->
- # AddExceptionHandler(), DefaultErrorHandler() ->
- # DefaultExceptionHandler()
- # <1.0.8> 1/19/95 KTA Added some of the CrashHandling stuff.
- # <1.0.7> 1/16/95 KTA Added _DebugStr().
- # <1.0.6> 1/13/95 KTA Updated Headers
- # <1.0.5> 12/14/94 KTA Readded marks
- # <1.0.4> 12/7/94 ML Correct parameter name in _Scroll
- # <1.0.3> 12/1/94 KTA Changed return values, will work if CommandExceptions is OFF.
- # Can check script error after all _Tasks.
- # <1.0.2> 11/30/94 ML Revised _MatchBoolean for -1105
- # <1.0.1> 11/30/94 ML Added _Gestalt
- #
- # ****************************************************************************
- #
-
- #########################################################################
- # AddExceptionHandler(pTheErrorList)
- #========================================================================
- # Description: pushes error list onto the global error handling stack
- # Parameters: pExceptionCode - (string, integer, List)
- # The code to identify the exception
- # pExceptionHandler - {list}
- # the Handler in the form: {Task reference,{Parameters} ThrowFlag}
- # Returns: true if it worked, false if not
- # Examples: AddExceptionHandler(-1100, {TASK crashRecover,{ "TeachText",1,5 },1});
- # Assumptions: none
- #========================================================================
- # History:
- #########################################################################
- TASK AddExceptionHandler(pExceptionCode, pExceptionHandler)
- begin
- global gExceptionHandlerList;
- returnval := 0;
- if(gExceptionHandlerList)
- begin
- thelist := {pExceptionCode, pExceptionHandler};
- gExceptionHandlerList := insert (thelist, 1, gExceptionHandlerList);
- returnval := 1;
- end;
- return (returnval);
- end;
-
- #########################################################################
- # RemoveExceptionHandler(pTheError)
- #========================================================================
- # Description: pop first instance of pTheError off the global error handling stack
- # Parameters: pTheError
- # Returns: true if it worked, false if not
- # Examples: RemoveExceptionHandler(-1100);
- # Assumptions: none
- #========================================================================
- # History:
- #########################################################################
- TASK RemoveExceptionHandler(pTheError)
- begin
- global gExceptionHandlerList;
- returnval := 0;
- HandlerData := assoc (pTheError, gExceptionHandlerList); # Call assoc to insure it exists and to get data so we can find which element.
- if (HandlerData)
- begin
- theItem := isMember({pTheError,HandlerData }, gExceptionHandlerList); # Call IsMember to findout which element to remove
- gExceptionHandlerList := remove(theItem,gExceptionHandlerList);
- returnVal := {pTheError,HandlerData };
- end;
- else
- println "!@#$% '{pTheError}' not in error list - could not pop";
- return (returnval);
- end;
-
-
-
- #########################################################################
- # SpecialHandlers()
- #========================================================================
- # Description:
- # Parameters:
- # Returns: true if it worked, false if not
- # Examples: SpecialHandlers(-);
- # Assumptions: none
- #========================================================================
- # History:
- # ML 3/6/95 Rename gSpecialErrorHandlers to gSpecialExceptionHandlers
- #########################################################################
- TASK SpecialHandlers(pErrorCode, pHanderList)
- begin
- returnVal := 0;
- if(global gSpecialExceptionHandlers) # List of Special Error handlers which handle groups of errors
- begin
- ##### ALL
- allErrorsList := assoc('all',gSpecialExceptionHandlers);
- if(allErrorsList)
- returnVal := call(allErrorsList[1],pErrorCode, allErrorsList[2]);
- else
- begin
- throwFlag := pHanderList[3];
- ##### ALLNONTHROWN
- if not (throwFlag) # If ThrowFlag not set
- begin
- allNonThrownErrorsList := assoc('allNonThrown',gSpecialExceptionHandlers);
- if(allNonThrownErrorsList)
- returnVal := call(allNonThrownErrorsList[1],pErrorCode, allNonThrownErrorsList[2]);
- end;
- else # ALLTHROWN - throwFlag set
- begin
- allThrownErrorsList := assoc('allThrown',gSpecialExceptionHandlers);
- if(allThrownErrorsList)
- returnVal := call(allThrownErrorsList[1],pErrorCode, allThrownErrorsList[2]);
- end;
- end;
- end;
- return(returnVal);
- end;
-
- #########################################################################
- # ExceptionDispatcher(pErrorCode, pHandleTheError)
- #========================================================================
- # Description: A mechanism for handling errors
- # Parameters: pErrorCode: The error code
- # Returns: result of error handler TASK call, or throw if fatal
- # Examples: ExceptionDispatcher(-1100)
- # Assumptions: VU 2.1, also needs a list of error codes/handlers defined in
- # global gExceptionHandlerList in the form:
- # { {
- # ErrCode, # Error Code
- # {
- # Handler, # TASK reference
- # {Parameters}, # List of Parameters
- # ThrowFlag # Flag indicating whether you want errors
- # } # with this code to be thrown
- # }, …
- # };
- #========================================================================
- # History:
- # KTA 2/16/95 Handle case when global gExceptionHandlerList is not defined
- # and when no handler (or default) is defined.
- # ML 2/17/94 Replace logstr() calls with Println
- #########################################################################
- TASK ExceptionDispatcher(pErrorCode, pHandleTheError:= 0, pErrorContext := {})
- begin
- global gExceptionHandlerList, gDebugExceptionHandling;
- returnval := 0;
- if gDebugExceptionHandling
- println "∑ Entering ExceptionDispatcher - Error: {pErrorCode}, task: {pErrorContext[1]} params: {pErrorContext[2]}";
- if global gExceptionDispatcherHook
- call (gExceptionDispatcherHook, pErrorCode, pErrorContext);
- if(gExceptionHandlerList)
- begin
- HandlerList := assoc(pErrorCode,gExceptionHandlerList);
- if not(HandlerList) # If no handler defined for error id - Check for a default handler
- HandlerList := assoc('default',gExceptionHandlerList); # assign default handler
- if not(HandlerList) # If no default handler then assign one.
- begin
- Println "!@#$% - WARNING - there was no handler defined for this error and there was no default, assigning a default handler";
- HandlerList := {task DefaultExceptionHandler, {1},0}; # assign default handler
- end;
- if not(SpecialHandlers(pErrorCode, HandlerList)) # If a SpecialHandler to handle
- begin # the error is not installed
- if ((HandlerList[3]) and not(pHandleTheError)) # Is ThrowFlag Set
- Throw(pErrorCode);
- else
- begin # ThrowFlag not set
- switch pErrorCode
- begin
- case 'placeholder':
- println "placeholder in ExceptionDispatcher";
- default:
- returnval := call(HandlerList[1],pErrorCode, HandlerList[2]);
- end;
- end;
- end;
- end;
- else # No gExceptionHandlerList defined
- begin
- Println "!@#$% - WARNING - the global gExceptionHandlerList is not defined, assigning a default handler";
- returnval := DefaultExceptionHandler(pErrorCode, {1});
- end;
- return (returnval);
- end;
-
-
- #########################################################################
- # DefaultExceptionHandler(pErrID, pParamList)
- #========================================================================
- # Description: Simple exception Handler that just prints the error code
- # and the list of parameters. We may add more as soon as
- # we figure out what functionality to add.
- # Parameters: pErrID: the error code
- # pParamList: list of parameters
- # Returns: 1
- # Examples: DefaultExceptionHandler({"param1", 2, {'param3'}})
- # Assumptions: VU 2.1
- #========================================================================
- # History:
- # ML 2/3/95 Add second element in pParamList for throw
- #########################################################################
- TASK DefaultExceptionHandler(pErrID, pParamList)
- begin
- if(pParamList[1])
- println "DefaultExceptionHandler() : error - {pErrID}/ Params - {pParamList}";
- if not(isUndefined(pParamList[2])) # Will allow us to exit old style quicklook scripts
- Throw pParamList[2];
- return(1);
- end;
-
- #########################################################################
- ##
- #########################################################################
-
- #########################################################################
- # _Match(pDescriptor, pExactFlag)
- #========================================================================
- # Description: Error checking prototype for descriptor matching
- # Parameters: pTheDesc: the descriptor to match, always looks for exact
- # (don't include '!')
- # Returns: [] - couldn't match
- # descriptor - successful match
- # Examples: _Match([window o:1]);
- # Assumptions: VU 2.1
- #========================================================================
- # History:
- # SBR 02/05/97 Return [] for match fail instead of 0.
- #########################################################################
- TASK _Match(pDescriptor := [target], pExactFlag := 0, pNotErrors := {-1105})
- begin
- try
- begin
- if(pExactFlag)
- return(match pDescriptor!);
- else
- return(match pDescriptor);
- end;
- catch theError
- begin
- if (theError = -1105) AND isMember(-1105, pNotErrors)
- # SBR Fixed 09/20/96
- #return theMatch; # -1105 = simple match failure
- return []; # -1105 = simple match failure
- else
- ExceptionDispatcher(theError,,{"_Match", {pDescriptor, pExactFlag}});
-
- # SBR Fixed 09/20/96
- #return(0);
- return [];
- end;
- end;
-
- #########################################################################
- # _MatchBoolean(pTheDesc)
- #========================================================================
- # Description: Error checking prototype for descriptor matching
- # Parameters: pTheDesc: the descriptor to match, always looks for exact
- # (don't include '!')
- # Returns: false - couldn't match
- # true - successful match
- # Examples: _MatchBoolean([window o:1]);
- # Assumptions: VU 2.1
- #========================================================================
- # History:
- # ML 11/30/94 Case out -1105
- # KTA 04/12/95 Added pExactFlag parameter
- # SBR 01/30/97 Return true or false, not 1 or 0
- #########################################################################
- TASK _MatchBoolean(pDescriptor := [target], pExactFlag := true)
- begin
- try
- begin
- if(pExactFlag)
- match pDescriptor!;
- else
- match pDescriptor;
-
- return(not ScriptError());
- end;
- catch theError
- begin
- if not(theError = -1105)
- ExceptionDispatcher(theError,,{"_MatchBoolean", {pDescriptor, pExactFlag}});
-
- return false;
- end;
- end;
-
- #########################################################################
- # _Select(pTheDesc)
- #========================================================================
- # Description: Error checking prototype for descriptor selecting
- # Parameters: pTheDesc: the descriptor to select
- # Returns: 0 - couldn't match
- # 1 - successful match
- # Examples: _Select([window o:1]);
- # Assumptions: VU 2.1
- #========================================================================
- # History:
- #########################################################################
- TASK _Select(pDescriptor := [target], pExactFlag := 0)
- begin
- try
- begin
- if(pExactFlag)
- select pDescriptor!;
- else
- select pDescriptor;
- end;
- catch theError
- ExceptionDispatcher(theError,,{"_Select", {pDescriptor, pExactFlag}});
- end;
-
- #########################################################################
- # _SelectBoolean(pTheDesc)
- #========================================================================
- # Description: Error checking prototype for descriptor matching
- # Parameters: pTheDesc: the descriptor to select, always looks for exact
- # (don't include '!')
- # Returns: false - couldn't select
- # true - successful select
- # Examples: _SelectBoolean([menuitem t:"Open" m: [menu t:"File"]]);
- # Assumptions: VU 2.1
- #========================================================================
- # History:
- # SBR 02/05/97 Return false for fail instead of 0.
- #########################################################################
- TASK _SelectBoolean(pDescriptor := [target], pExactFlag := true)
- begin
- try
- begin
- if(pExactFlag)
- select pDescriptor!;
- else
- select pDescriptor;
- return(not ScriptError());
- end;
- catch theError
- begin
- if not ((theError = -1105) or (theError = -1106))
- ExceptionDispatcher(theError,,{"_SelectBoolean", {pDescriptor, pExactFlag}});
- return false;
- end;
- end;
-
- #########################################################################
- # _Drag(pTheDesc)
- #========================================================================
- # Description: Error checking prototype for descriptor selecting
- # Parameters: pTheDesc: the descriptor to select
- # Returns: 0 - couldn't match
- # 1 - successful match
- # Examples: _Drag([window o:1]);
- # Assumptions: VU 2.1
- #========================================================================
- # History:
- #########################################################################
- TASK _Drag(pDescriptor := [target], pHow := 'a', pCoords := {}, pExactFlag := 0)
- begin
- try
- begin
- if(pExactFlag)
- begin
- switch pHow
- begin
- case 'a': # absolute
- drag pDescriptor a:pCoords!;
- default: # relative
- drag pDescriptor r:pCoords!;
- end;
- end;
- else
- begin
- switch pHow
- begin
- case 'a': # absolute
- drag pDescriptor a:pCoords;
- default: # relative
- drag pDescriptor r:pCoords;
- end;
- end;
- end;
- catch theError
- ExceptionDispatcher(theError,,{"_Drag", {pDescriptor, pHow, pCoords, pExactFlag}});
- end;
-
- #########################################################################
- # _Size(pTheDesc)
- #========================================================================
- # Description: Error checking prototype for descriptor selecting
- # Parameters: pWindowDesc: the window descriptor to select
- # pHow: how to size
- # r - relative
- # w - width only
- # h - height only
- # wh - both width and height
- # pCoords: list of coord(s). Single element list if pHow is
- # w or h, two element list (width, height) if r or wh.
- # Returns: 0 - couldn't match
- # 1 - successful match
- # Examples: _Size([window o:1]);
- # Assumptions: VU 2.1
- #========================================================================
- # History:
- # ML 11/15/95 switch on pHow, default to 'wh', rename 1st param,
- # default to window desc.
- #########################################################################
- TASK _Size(pWindowDesc := [window o:1], pHow := 'wh', pCoords := {}, pExactFlag := 0)
- begin
- try
- begin
- if(pExactFlag)
- begin
- switch pHow
- begin
- case 'r': # relative
- size pWindowDesc r:pCoords!;
- case 'w': # only width
- size pWindowDesc w:pCoords[1]!;
- case 'h': # Only height
- size pWindowDesc h:pCoords[1]!;
- default: # width and height
- size pWindowDesc w:pCoords[1] h:pCoords[2]!;
- end;
- end;
- else
- begin
- switch pHow
- begin
- case 'r': # relative
- size pWindowDesc r:pCoords;
- case 'w': # only width
- size pWindowDesc w:pCoords[1];
- case 'h': # Only height
- size pWindowDesc h:pCoords[1];
- default: # width and height
- size pWindowDesc w:pCoords[1] h:pCoords[2];
- end;
- end;
- end;
- catch theError
- ExceptionDispatcher(theError,,{"_Size", {pWindowDesc, pHow, pCoords, pExactFlag}});
- end;
-
- #########################################################################
- # _Close(pDescriptor, pExactFlag)
- #========================================================================
- # Description: Error checking prototype for descriptor matching
- # Parameters: pTheDesc: the descriptor to match, always looks for exact
- # (don't include '!')
- # Returns: 0 - couldn't match
- # 1 - successful match
- # Examples: _Close([window o:1]);
- # Assumptions: VU 2.1
- #========================================================================
- # History:
- #########################################################################
- TASK _Close(pDescriptor := [], pExactFlag := 0)
- begin
- try
- begin
- if(pExactFlag)
- Close pDescriptor!;
- else
- Close pDescriptor;
- end;
- catch theError
- ExceptionDispatcher(theError,,{"_Close", {pDescriptor, pExactFlag}});
- end;
-
- #########################################################################
- # _Zoom(pDescriptor, pExactFlag)
- #========================================================================
- # Description: Error checking prototype for descriptor matching
- # Parameters: pTheDesc: the descriptor to match, always looks for exact
- # (don't include '!')
- # Returns: 0 - couldn't match
- # 1 - successful match
- # Examples: _Zoom([window o:1]);
- # Assumptions: VU 2.1
- #========================================================================
- # History:
- #########################################################################
- TASK _Zoom(pDescriptor := [], pExactFlag := 0)
- begin
- try
- begin
- if(pExactFlag)
- zoom pDescriptor!;
- else
- zoom pDescriptor;
- end;
- catch theError
- ExceptionDispatcher(theError,,{"_Zoom", {pDescriptor, pExactFlag}});
- end;
-
- #########################################################################
- # _Scroll(pTheDesc)
- #========================================================================
- # Description: Error checking prototype for descriptor selecting
- # Parameters: pTheDesc: the descriptor to select
- # Returns: 0 - couldn't match
- # 1 - successful match
- # Examples: _Scroll([window o:1]);
- # Assumptions: VU 2.1
- #========================================================================
- # History:
- # ML 12/7/94 Changed pPositions to pCoords in task declaration
- #########################################################################
- TASK _Scroll(pDescriptor := [target], pHow := 'a', pCoords := {}, pExactFlag := 0)
- begin
- try
- begin
- if(pExactFlag)
- begin
- switch pHow
- begin
- case 'a': # absolute
- scroll pDescriptor a:pCoords!;
- default: # relative
- scroll pDescriptor r:pCoords!;
- end;
- end;
- else
- begin
- switch pHow
- begin
- case 'a': # absolute
- scroll pDescriptor a:pCoords;
- default: # relative
- scroll pDescriptor r:pCoords;
- end;
- end;
- end;
- catch theError
- ExceptionDispatcher(theError,,{"_Scroll", {pDescriptor, pHow, pCoords, pExactFlag}});
- end;
-
-
- #########################################################################
- # _Type(pTheDesc)
- #========================================================================
- # Description: Error checking prototype for descriptor selecting
- # Parameters: pTheDesc: the descriptor to select
- # Returns: 0 - couldn't match
- # 1 - successful match
- # Examples: _Scroll([window o:1]);
- # Assumptions: VU 2.1
- #========================================================================
- # History:
- #########################################################################
- TASK _Type(pKeyList := {}, pCodeList := {}, pPad := 0, pKeyStrokesFirst := 1)
- begin
- try
- begin
- if(pKeyStrokesFirst)
- Type k:pKeyList c:pCodeList p:pPad;
- else
- Type c:pCodeList k:pKeyList p:pPad;
- end;
- catch theError
- ExceptionDispatcher(theError,,{"_Type", {pKeyList, pCodeList, pPad, pKeyStrokesFirst}});
- end;
-
- #########################################################################
- # _PressKey(pTheDesc)
- #========================================================================
- # Description: Error checking prototype for descriptor selecting
- # Parameters: pTheDesc: the descriptor to select
- # Returns: 0 - couldn't match
- # 1 - successful match
- # Examples: _PressKey([window o:1]);
- # Assumptions: VU 2.1
- #========================================================================
- # History:
- #########################################################################
- TASK _PressKey(pKeyList := {}, pCodeList := {}, pPad := 0)
- begin
- try
- Presskey k:pKeyList c:pCodeList p:pPad;
- catch theError
- ExceptionDispatcher(theError,,{"_PressKey", {pKeyList, pCodeList, pPad}});
- end;
- #########################################################################
- # _ReleaseKey(pTheDesc)
- #========================================================================
- # Description: Error checking prototype for descriptor selecting
- # Parameters: pTheDesc: the descriptor to select
- # Returns: 0 - couldn't match
- # 1 - successful match
- # Examples: _ReleaseKey([window o:1]);
- # Assumptions: VU 2.1
- #========================================================================
- # History:
- #########################################################################
- TASK _ReleaseKey(pKeyList := {}, pCodeList := {}, pPad := 0)
- begin
- try
- ReleaseKey k:pKeyList c:pCodeList p:pPad;
- catch theError
- ExceptionDispatcher(theError,,{"_ReleaseKey", {pKeyList, pCodeList, pPad}});
- end;
- #########################################################################
- # _Move(pTheDesc)
- #========================================================================
- # Description: Error checking prototype for descriptor selecting
- # Parameters: pTheDesc: the descriptor to select
- # Returns: 0 - couldn't match
- # 1 - successful match
- # Examples: _Move([window o:1]);
- # Assumptions: VU 2.1
- #========================================================================
- # History:
- #########################################################################
- TASK _Move(pHow := 'a', pCoords := {})
- begin
- try
- begin
- switch pHow
- begin
- case 'a': # absolute
- Move a:pCoords;
- default: # relative
- Move r:pCoords;
- end;
- end;
- catch theError
- ExceptionDispatcher(theError,,{"_Move", {pHow, pCoords}});
- end;
- #########################################################################
- # _Click(pTheDesc)
- #========================================================================
- # Description: Error checking prototype for descriptor selecting
- # Parameters: pTheDesc: the descriptor to select
- # Returns: 0 - couldn't match
- # 1 - successful match
- # Examples: _Click([window o:1]);
- # Assumptions: VU 2.1
- #========================================================================
- # History:
- #########################################################################
- TASK _Click()
- begin
- try
- Click;
- catch theError
- ExceptionDispatcher(theError,,{"_Click"});
- end;
- #########################################################################
- # _DoubleClick(pTheDesc)
- #========================================================================
- # Description: Error checking prototype for descriptor selecting
- # Parameters: pTheDesc: the descriptor to select
- # Returns: 0 - couldn't match
- # 1 - successful match
- # Examples: _DoubleClick([window o:1]);
- # Assumptions: VU 2.1
- #========================================================================
- # History:
- #########################################################################
- TASK _DoubleClick()
- begin
- try
- doubleClick;
- catch theError
- ExceptionDispatcher(theError,,{"_DoubleClick"});
- end;
- #########################################################################
- # _PressMouse(pTheDesc)
- #========================================================================
- # Description: Error checking prototype for descriptor selecting
- # Parameters: pTheDesc: the descriptor to select
- # Returns: 0 - couldn't match
- # 1 - successful match
- # Examples: _PressMouse([window o:1]);
- # Assumptions: VU 2.1
- #========================================================================
- # History:
- #########################################################################
- TASK _PressMouse()
- begin
- try
- PressMouse;
- catch theError
- ExceptionDispatcher(theError,,{"_PressMouse"});
- end;
- #########################################################################
- # _ReleaseMouse(pTheDesc)
- #========================================================================
- # Description: Error checking prototype for descriptor selecting
- # Parameters: pTheDesc: the descriptor to select
- # Returns: 0 - couldn't match
- # 1 - successful match
- # Examples: _ReleaseMouse([window o:1]);
- # Assumptions: VU 2.1
- #========================================================================
- # History:
- #########################################################################
- TASK _ReleaseMouse()
- begin
- try
- ReleaseMouse;
- catch theError
- ExceptionDispatcher(theError,,{"_ReleaseMouse"});
- end;
- #########################################################################
- # _Launch(pTheDesc)
- #========================================================================
- # Description: Error checking prototype for descriptor selecting
- # Parameters: pTheDesc: the descriptor to select
- # Returns: 0 - couldn't match
- # 1 - successful match
- # Examples: _Launch([window o:1]);
- # Assumptions: VU 2.1
- #========================================================================
- # History:
- # MDF 06/17/96 Added pInForeground to parameter.
- #########################################################################
- TASK _Launch(pApplication := '', pOntarget := TRUE, pInForeground := TRUE)
- begin
- try
- return(Launch(pApplication, pOntarget, pInForeground));
- catch theError
- begin
- ExceptionDispatcher(theError,,{"_Launch", {pApplication, pOntarget, pInForeground}});
- return (0);
- end;
- end;
-
- #########################################################################
- # _Collect(pDescriptor, pExactFlag)
- #========================================================================
- # Description: Error checking prototype for descriptor matching
- # Parameters: pTheDesc: the descriptor to match, always looks for exact
- # (don't include '!')
- # Returns: {} - couldn't match
- # descriptor list - successful match
- # Examples: _Collect([window o:1]);
- # Assumptions: VU 2.1
- #========================================================================
- # History:
- # SBR 02/05/97 Return {} for match fail instead of 0.
- #########################################################################
- TASK _Collect(pDescriptor := [target], pExactFlag := 0)
- begin
- try
- begin
- if(pExactFlag)
- return(collect pDescriptor!);
- else
- return(collect pDescriptor);
- end;
- catch theError
- begin
- if theError <> -1105
- ExceptionDispatcher(theError,,{"_Collect", {pDescriptor, pExactFlag}});
-
- ###SBR Fixed 01/10/97
- #return (0);
- return {};
- ###SBR Fixed
- end;
- end;
-
- #########################################################################
- # _Gestalt(pSelector)
- #========================================================================
- # Description: Error checking for gestalt
- # Parameters: pSelector: gestalt selector
- # Returns: 0 - unsuccesful gestalt call
- # {list} - gestalt result
- # Examples: _Gestalt('sysv');
- # Assumptions: VU 2.1
- #========================================================================
- # History:
- #########################################################################
- TASK _Gestalt(pSelector)
- begin
- try
- return(gestalt(pSelector));
- catch theError
- begin
- ExceptionDispatcher(theError,,{"_Gestalt", {pSelector}});
- return (0);
- end;
- end;
-
- #########################################################################
- # _DebugStr(pTheString, pAtSystemTaskTime)
- #========================================================================
- # Description: Invokes our exceptionHandling mechanism for the DebugStr call.
- # Parameters: pTheString: debug string e.g. ';ht'
- # pAtSystemTaskTime - indicate interupt or systemTask time
- # Returns: nothing
- # Examples: _DebugStr(';ht;g');
- # Assumptions: VU 2.1
- #========================================================================
- # History:
- #########################################################################
- TASK _DebugStr(pTheString, pAtSystemTaskTime := false)
- begin
- try
- DebugStr(pTheString, pAtSystemTaskTime);
- catch theError
- ExceptionDispatcher(theError,,{"_DebugStr", {pTheString, pAtSystemTaskTime}});
- end;
-
-